/*
 * @Author: namelll 2677065112@qq.com
 * @Date: 2023-06-05 14:17:17
 * @LastEditors: namelll 2677065112@qq.com
 * @LastEditTime: 2023-06-07 14:19:00
 * @FilePath: \vue3-ts-project\src\router\routes.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * @Author: namelll 2677065112@qq.com
 * @Date: 2023-06-05 14:17:17
 * @LastEditors: namelll 2677065112@qq.com
 * @LastEditTime: 2023-06-06 10:06:54
 * @FilePath: \vue3-ts-project\src\router\routes.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
//常量路由
export const constantRoute = [
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录',
            hidden: true,
        }
    },

    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '',
            hidden: false,
            icon: ''
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled'
                }
            }
        ]
    },

    {
        path: '/screen',
        component: () => import('@/views/screen/index.vue'),
        name: 'screen',
        meta: {
            title: '数据大屏',
            hidden: false,
            icon: 'Platform'
        }
    },

    {
        path: '/acl',
        component: () => import('@/layout/index.vue'),
        name: 'acl',
        meta: {
            title: '管理中心',
            hidden: false,
            icon: 'Tools'
        },
        redirect: '/acl/user',
        children: [
            {
                path: '/acl/user',
                component: () => import('@/views/acl/user/index.vue'),
                name: 'user',
                meta: {
                    title: '用户管理',
                    icon: 'User'
                }
            },
            {
                path: '/acl/role',
                component: () => import('@/views/acl/role/index.vue'),
                name: 'role',
                meta: {
                    title: '权限管理',
                    icon: 'Lock'
                }
            },
            {
                path: '/acl/menu',
                component: () => import('@/views/acl/menu/index.vue'),
                name: 'menu',
                meta: {
                    title: '菜单管理',
                    icon: 'Grid'
                }
            }
        ]
    },

    {
        path: '/product',
        component: () => import('@/layout/index.vue'),
        name: 'product',
        meta: {
            title: '商品管理',
            hidden: false,
            icon: 'Goods'
        },
        redirect: '/product/trademark',
        children: [
            {
                path: '/product/trademark',
                component: () => import('@/views/product/trademark/index.vue'),
                name: 'trademark',
                meta: {
                    title: '品牌管理',
                    icon: 'GoldMedal'
                }
            },
            {
                path: '/product/attr',
                component: () => import('@/views/product/attr/index.vue'),
                name: 'attr',
                meta: {
                    title: '属性管理',
                    icon: 'Tickets'
                }
            },
            {
                path: '/product/sku',
                component: () => import('@/views/product/sku/index.vue'),
                name: 'sku',
                meta: {
                    title: 'sku管理',
                    icon: 'List'
                }
            },
            {
                path: '/product/spu',
                component: () => import('@/views/product/spu/index.vue'),
                name: 'spu',
                meta: {
                    title: 'spu管理',
                    icon: 'List'
                }
            },

        ]
    },

    {
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true
        }
    },

    {
        path: '/:pathMatch(.*)*',//.*表示匹配任意字符，而*表示匹配前面的字符出现任意次数
        redirect: '/404',
        name: 'any',
        meta: {
            title: '任意路由',
            hidden: true
        }

    },
]
//为什么使用懒加载
//在访问某个路径的时候再去加载对应组件，打包时也会成为单独的js文件